r = 1 gotknife = 1 bear = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH, EAST, OR WEST" directions(3) = "WEST" directions(4) = "EAST OR SOUTH" directions(5) = "NORTH OR SOUTH" directions(6) = "NORTH OR EAST" directions(7) = "WEST OR EAST" directions(8) = "NORTH OR WEST" directions(9) = "SOUTH" PRINT "" PRINT "" PRINT "You return from your hike from which you've had an amazing time. You examine" PRINT "your campsite only to find that some wild animal has gone through everything." PRINT "But it lurks in the woods, hiding behind the wall of nature, and waits for" PRINT "you, to fail. It craves human flesh." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Grizzly " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotknife = 1 THEN: PRINT "A stainless steel hunting knife." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 4 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 3: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 9 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 4: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 6: GOTO moved END IF IF (cmd$ = "USE KNIFE") THEN CLS PRINT "You take out the knife and hold it tightly. You feel as if you have" PRINT "chance in surviving but alas you know it'll be a hell of a fight." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE GRIZZLY") AND r = 9 THEN CLS PRINT "A behemoth of a Grizzly Bear stands before you. It gets on it's back" PRINT "legs and lets out a mighty roar. It's eye's are red and it appears to" PRINT "to be in demonic possession." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE KNIFE") AND gotknife = 1 THEN CLS PRINT "A stainless steel knife about eight inches long. It has a marble" PRINT "handle and it wasn't cheap." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE KNIFE") AND gotknife = 1 AND r = 9 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "PLAY DEAD") AND r = 9 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing in the middle of what was your campsite. You" PRINT "feel that you aren't alone here. Best to leave now and hopefully" PRINT "you'll reach your car before nightfall." RETURN r2: PRINT "The path narrows and is littered with branches and rocks." RETURN r3: PRINT "You are standing before a steep ledge, that goe's right up to" PRINT "the river." RETURN r4: PRINT "The fresh air and the vast amount of tree's makes you feel as" PRINT "if you are at one with nature truly is a great feeling." RETURN r5: PRINT "The smell of the pine, the birds chirping, and the feeling of" PRINT "being watched comes over you. How you wish to finally escape this" PRINT "place." RETURN r6: PRINT "A strong scent fills the air and begin's to make you feel as if you" PRINT "are coming close to some monster." RETURN r7: PRINT "As quickly as you heard the sounds of nature and life surround you." PRINT "They are now absent and a chill runs down your back." RETURN r8: PRINT "-Eureka-, you see the car in the distance. A wave of relief washes" PRINT "over you and you could swear to hear birds chirping." RETURN r9: PRINT "Only a few feet away from the car, then suddenly you see from the" PRINT "corner of your eye the massive Grizzly." RETURN win: COLOR 2, 0 CLS PRINT "As the bear charges towards you, you take out your knife and" PRINT "take a blind swing. Your life is flashing before your eye's" PRINT "and just as luck blesses you, you find that the swing you have" PRINT "taken cuts the bear upon her nose. Quickly she flee's groaning" PRINT "in pain. That'll teach her for charging at you to a battle to" PRINT "the death. You return home, knowing that upon this day you have" PRINT "defeated nature." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "You fall to the ground and close your eye's. Hoping that the" PRINT "mighty Grizzly ignores you. But not the case, as she walks over" PRINT "to, she places her mighty paw upon your neck and without any" PRINT "notice, she crushes your throat...pity." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "Before you know it, the sun sets, and you are trapped wandering the woods" PRINT "until you are rescues by a Ranger. It's been days since you've showered" PRINT "and yet, you are thankful for being alive." _DISPLAY END END SUB